<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增会议')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-meeting-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">会议主题：</label>
                <div class="col-sm-8">
                    <input name="topic" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">主持人：</label>
                <div class="col-sm-8">
                    <input name="host" class="form-control" type="text" th:value="${user.loginName}" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">会议地址：</label>
                <div class="col-sm-8">
                    <input name="place" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">参会人员：</label>
                <div class="col-xs-8">
                    <select id="post" name="peoplelist" class="form-control select2-multiple" multiple>
                        <option th:each="post:${userlist}" th:value="${post.loginName}" th:text="${post.userName}" th:disabled="${post.status == '1'}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="startTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="endTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "meeting"
        $("#form-meeting-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-meeting-add').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            autoclose: true
        });
    </script>
</body>
</html>